<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script  src="js/axios.js"></script>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="d">
    <button @click="test()">测试</button>
</div>
<script>
    new Vue({
        el:"#d",
        methods:{
            test(){
                axios({
                    method:"post",
                    url:"http://localhost/test",
                    headers:{token:localStorage.getItem('mytoken')}
                }).then(ret=> {
                    alert(ret.data);
                });
            }
        }
    });
</script>
</body>
</html>